package com.xiaohang.springstudy.chapter1.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
// 解决返回application/json时json对象转换错误
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@Table(name = "user")
@Entity
public class UserDo implements Serializable {

    private static final long serialVersionUID = 8357594722491336507L;
    @Id
    private Long id;
    private String name;
    private Integer age;
}
